﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using StateGrid.MDBservice;

namespace StateGrid.ZWHY
{
    /// <summary>
    /// Summary description for ZWHY_PM
    /// </summary>
    public class ZWHY_PM : PM
    {
        /// <summary>
        /// 索引编码
        /// </summary>
        public String sybm{
            get;
            set;
        }
        
        /// <summary>
        /// 文件名
        /// </summary>
        public String wjm{
            get;
            set;
        }

        /// <summary>
        /// 原文件名
        /// </summary>
        public String ywjm{
            get;
            set;
        }

        /// <summary>
        /// 中文篇名
        /// </summary>
        public String zwpm{
            get;
            set;
        }

        /// <summary>
        /// 外文篇名
        /// </summary>
        public String wwpm{
            get;
            set;
        }

        /// <summary>
        /// 作者
        /// </summary>
        public String zz{
            get;
            set;
        }

        /// <summary>
        /// 作者单位
        /// </summary>
        public String zzdw{
            get;
            set;
        }

        /// <summary>
        /// 中文文摘
        /// </summary>
        public String zwwz{
            get;
            set;
        }

        /// <summary>
        /// 外文文摘
        /// </summary>
        public String wwwz{
            get;
            set;
        }

        /// <summary>
        /// 中文主题词
        /// </summary>
        public String zwztc{
            get;
            set;
        }

        /// <summary>
        /// 外文主题词
        /// </summary>
        public  String wwztc{
            get;
            set;
        }

        /// <summary>
        /// 页数
        /// </summary>
//        public int ys{
//            get;
//            set;
//        }

        /// <summary>
        /// 国图分类
        /// </summary>
        public String gtfl{
            get;
            set;
        }
        /// <summary>
        /// 馆藏号
        /// </summary>
        public String gch{
            get;
            set;
        }

        /// <summary>
        /// 更新日期
        /// </summary>
        public DateTime gxrq{
            get;
            set;
        }

        /// <summary>
        /// 登录人
        /// </summary>
        public String dlr{
            get;
            set;
        }

        /// <summary>
        /// 更新项
        /// </summary>
        public String gxx{
            get;
            set;
        }

        public ZWHY_PM()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public override string ToString()
        {
            String ret;
            ret = "[索引编码]" + this.sybm + " [中文篇名]" + this.zwpm;
            return ret;
        }

        public override string AllContent()
        {
            String ret = "('" + sybm + "','" + wjm + "','" + zwpm + "','" + wwpm + "','" + zz + "','" + zzdw + "','" + zwwz + "','" + zwztc + "','" + wwwz + "','" + wwztc + "','" + ys + "','" + gtfl + "','" + gch + "','" + ywjm + "','" + dlr + "','" + gxrq + "','" + gxx + "')";
            return ret;
        }

        public override void fillEmptyStringAsNull()
        {
            String temp = "NULL";
            if (String.Empty.Equals(this.sybm)) sybm = temp;
            if (String.Empty.Equals(this.wjm)) wjm = temp;
            if (String.Empty.Equals(this.zwpm)) zwpm = temp;
            if (String.Empty.Equals(this.wwpm)) wwpm = temp;
            if (String.Empty.Equals(this.zz)) zz = temp;
            if (String.Empty.Equals(this.zzdw)) zzdw = temp;
            if (String.Empty.Equals(this.zwwz)) zwwz = temp;
            if (String.Empty.Equals(this.wwwz)) wwwz = temp;
            if (String.Empty.Equals(this.zwztc)) zwztc = temp;
            if (String.Empty.Equals(this.wwztc)) wwztc = temp;
            //跳过整型 “页数”
            if (String.Empty.Equals(this.gtfl)) gtfl = temp;
//            if (String.Empty.Equals(this.gch)) gch = temp;
            if (String.Empty.Equals(this.ywjm)) ywjm = temp;
            if (String.Empty.Equals(this.dlr)) dlr = temp;
            //跳过DataTime型 "更新日期"
            if (String.Empty.Equals(this.gxx)) gxx = temp;
        }

        public override void eraseNullInEmptyString()
        {
            String temp = "NULL";
            if (temp.Equals(this.sybm)) sybm = String.Empty;
            if (temp.Equals(this.wjm)) wjm = String.Empty;
            if (temp.Equals(this.zwpm)) zwpm = String.Empty;
            if (temp.Equals(this.wwpm)) wwpm = String.Empty;
            if (temp.Equals(this.zz)) zz = String.Empty;
            if (temp.Equals(this.zzdw)) zzdw = String.Empty;
            //跳过整型 “页数”
            if (temp.Equals(this.zwwz)) zwwz = String.Empty;
            if (temp.Equals(this.wwwz)) wwwz = String.Empty;
            if (temp.Equals(this.zwztc)) zwztc = String.Empty;
            if (temp.Equals(this.wwztc)) wwztc = String.Empty;
            if (temp.Equals(this.gtfl)) gtfl = String.Empty;
            if (temp.Equals(this.gch)) gch = String.Empty;
            if (temp.Equals(this.ywjm)) ywjm = String.Empty;
            if (temp.Equals(this.dlr)) dlr = String.Empty;
            //跳过DataTime型 "更新日期"
            if (temp.Equals(this.gxx)) gxx = String.Empty;
        }
    }
}